package com.sh.cloudrender.application.web.controller;

import com.aliyun.gts.sso.domain.LoginAccount;
import com.sh.cloudrender.application.service.UserService;
import lombok.extern.slf4j.Slf4j;
import com.sh.cloudrender.common.dto.ShXResponse;
import com.sh.cloudrender.common.utils.ShXResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/v1/user")
public class UserProjectController {
    @Autowired
    private UserService userService;

    @RequestMapping(value = {"/getCurrentUser"})
    public ShXResponse<LoginAccount> getCurrentUserInfo() {
        LoginAccount account = userService.getCurrentUser();
        System.out.println("account" + account);
        return ShXResponseUtil.build(200, "get user success", account);
    }
}
